﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using DataAnnotationsExtensions;

namespace Entity.Admin
{
    [MetadataType(typeof(UserMetadata))]
    public partial class User
    {
        class UserMetadata
        {
            [HiddenInput(DisplayValue = false)]
            public string ID { get; set; }

            [Required]
            [Display(Name = "用户名", Order = 1)]
            public string UserName { get; set; }

            [Required]
            [DataType(DataType.Password)]
            [Display(Name = "密码", Order = 2)]
            public string Password { get; set; }

            [DataType(DataType.EmailAddress)]
            [Display(Name = "邮箱", Order = 3)]
            [Email(ErrorMessage = "邮箱地址不正确")]
            public string Email { get; set; }

            [DataType(DataType.PhoneNumber)]
            [Display(Name = "手机", Order = 4)]
            public string MobilePIN { get; set; }

            [Display(Name = "密码问题", Order = 5)]
            public string PasswordQuestion { get; set; }

            [Display(Name = "密码答案", Order = 6)]
            public string PasswordAnswer { get; set; }

            [Display(Name = "锁定", Order = 7)]
            public bool IslockedOut { get; set; }

            [Display(Name = "创建时间", Order = 8)]
            [HiddenInput(DisplayValue=false)]
            public Nullable<System.DateTime> CreateDate { get; set; }

            [Display(Name = "上次登录时间", Order = 9)]
            [HiddenInput(DisplayValue = false)]
            public Nullable<System.DateTime> LastLoginDate { get; set; }

            [Display(Name = "上次密码修改时间", Order = 10)]
            [HiddenInput(DisplayValue = false)]
            public Nullable<System.DateTime> LastPasswordChangedDate { get; set; }

            [Display(Name = "上次帐号锁定时间", Order = 11)]
            [HiddenInput(DisplayValue = false)]
            public Nullable<System.DateTime> LastLockoutDate { get; set; }

            [DataType(DataType.Html)]
            [Display(Name = "备注", Order = 7)]
            public string Comment { get; set; }
        }
    }
}
